# include<stdio.h>
int main(void)
{
	int n,a[100],i,one=0,five=0,ten=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	for(i=0;i<n;i++)
	{
		if(a[i]==1)
			one++;
		if(a[i]==5)
			five++;
		if(a[i]==10)
			ten++;
	}
	printf("%d\n",one);
	printf("%d\n",five);
	printf("%d\n",ten);

	return 0;
}